package com.houcine.dao;

import java.util.List;

import javax.persistence.Query;

import com.houcine.entity.Author;

public class AuthorDAO extends GenericJPADAO<Author, Integer> {

	@SuppressWarnings("unchecked")
	public List<Author> list(int page, int size) {
	    Query query = this.em.createQuery("from Author order by firstName");
	    query.setFirstResult((page - 1) * size);
	    query.setMaxResults(size);
	    return query.getResultList();
	}
}
